<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>全局组件与x-template</title>
</head>
<body>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.31/vue.global.min.js"></script>
    <div id="app">
        <div>根组件<hd-xj /></div>      
    </div>
    <script type="text/x-template" id="hdTemplate">
        <p>子组件1</p>
    </script>
    <script>
        const app = Vue.createApp({});

        app.component('hd',{
            template:'#hdTemplate'
        });

        app.component('hdXj',{
            template:`<p><hd /> ---------- 子组件2 --------- <hdXiasnn /></p>`
        });

        app.component('hdXiasnn',{
            template:`<span>子组件3</apan>`
        });

        app.mount("#app");
    </script>
</body>
</html>